<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<html>
<%@ include file="../inc/PrintTitle.jsp"%>
<style type="text/css">
<!--
.style4 {font-size: x-large}
.style5 {font-size: large}
table{border-collapse:collapse;border-spacing:0;}
.small_border,.small_border td{ border:1px solid #000000;}
-->
</style>
<head>
<script language="javascript">
	function doPrint(){
		if(confirm("确定开始打印吗?")){
			document.getElementById("printTr").style.display="none";
			try{
				//保留客户打印机设置
				var h = factory.printing.header;
				var f = factory.printing.footer;
				var t = factory.printing.topMargin;
				var b = factory.printing.bottomMargin;
				var l = factory.printing.leftMargin;
				var r = factory.printing.rightMargin;
			
				factory.printing.header = "";
				factory.printing.footer = "";
				factory.printing.topMargin = "5";
				factory.printing.bottomMargin = "5";
				factory.printing.leftMargin="0";
				factory.printing.rightMargin="0";
			
				// 直接打印
				factory.DoPrint(false);//true时弹出打印对话框
				//返回到原来的打印设置
				factory.printing.header = h;
				factory.printing.footer = f;
				factory.printing.topMargin = t;
				factory.printing.bottomMargin = b;
			}catch(e){
				wb.execwb(7,1);
			}
			document.getElementById("printTr").style.display="";
		}
	}
	function doCancel(){
		parent.window.close();
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<OBJECT id="factory" style="DISPLAY: none" codeBase="/ScriptX.cab#Version=5,60,0,360"  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" viewastext></OBJECT>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<table width="680" border="0"  align="center" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td width="10%" rowspan="3" align="left" valign="top" ><img src="${enterpriseInfo.image}" />
					</td>
				<td width="90%" valign="bottom" ><div align="center" class="style5"><strong>${licenseInfo.enterpriseName}</strong></div></td>
				</tr>
				<tr>
				  <td valign="top" ><div align="center" class="style5"><strong>采购付款一览表</strong></div></td>
				</tr>				
		  </table>
		</td>
	</tr>
	<tr>
		<td align="center">
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" class="ListTable">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" >付款累计：${total}元</td>
				</tr>
			</table>
		</td>
	</tr>
	<c:if test="${fn:length(imprestList)>0}">
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<td class="FontSmall_Bold" align="center" width="15%">预付日期</td>
					<td class="FontSmall_Bold" align="center" width="20%">单号</td>
					<td class="FontSmall_Bold" align="center" width="8%">进/退</td>
					<td class="FontSmall_Bold" align="center" width="17%">供应商</td>
					<td class="FontSmall_Bold" align="center" width="12%">金额（元）</td>
					<td class="FontSmall_Bold" align="center" width="18%">银行账户</td>							
					<td class="FontSmall_Bold" align="center" width="10%">经办人</td>						
				</tr>
				<c:forEach var="item" items="${imprestList}" varStatus="i">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="center"><fmt:formatDate value="${item[0].purchaseBill.purchaseDate}" pattern="yyyy-MM-dd"/></td>
					<td class="FontSmall" align="center">${item[0].purchaseBill.billCode}</td>
					<td class="FontSmall" align="center">
						<c:if test="${item[0].purchaseBill.billType=='BUY'}">进</c:if>
						<c:if test="${item[0].purchaseBill.billType=='BACK'}">退</c:if>
					</td>
					<td class="FontSmall" align="center">${item[1].estName}</td>
					<td class="FontSmall" align="right">
						<c:if test="${item[0].purchaseBill.billType=='BUY'}">${item[0].purchaseBill.imprest}</c:if>
						<c:if test="${item[0].purchaseBill.billType=='BACK'}">${0-item[0].purchaseBill.imprest}</c:if>
						&nbsp;
					</td>
					<td class="FontSmall" align="center"><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${item[0].purchaseBill.bankAccountId}" />&nbsp;</td>
					<td class="FontSmall" align="center">${item[0].purchaseBill.managerName}&nbsp;</td>
				</tr>
				</c:forEach>
		  </table>
		</td>
	</tr>
	</c:if>
	<c:if test="${fn:length(payList)>0}">
	<tr>
		<td height="5"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<td class="FontSmall_Bold" align="center" width="15%">付款日期</td>
					<td class="FontSmall_Bold" align="center" width="20%">单号</td>
					<td class="FontSmall_Bold" align="center" width="25%">供应商</td>
					<td class="FontSmall_Bold" align="center" width="12%">金额（元）</td>
					<td class="FontSmall_Bold" align="center" width="18%">银行账户</td>
					<td class="FontSmall_Bold" align="center" width="10%">经办人</td>
				</tr>
				<c:forEach var="item" items="${payList}" varStatus="i">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="center"><fmt:formatDate value="${item[0].payBill.payDate}" pattern="yyyy-MM-dd"/></td>
					<td class="FontSmall" align="center">${item[0].payBill.billCode}</td>
					<td class="FontSmall" align="center">${item[1].estName}</td>
					<td class="FontSmall" align="right">${item[0].payBill.cost}&nbsp;</td>
					<td class="FontSmall" align="center"><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${item[0].payBill.bankAccountId}" /></td>
					<td class="FontSmall" align="center">${item[0].payBill.managerName}</td>
				</tr>
				</c:forEach>
		  </table>
		</td>
	</tr>
	</c:if>
	<tr>
		<td height="3"></td>
	</tr>
	<tr id="printTr">
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value="开始打印 " onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>